package remote.skins
{
	import flash.display.Graphics;
	
	import remote.controls.Component;
	import remote.controls.IListItemRender;
	import remote.enums.MouseStatus;

	public class DefaultListItemSkin extends SkinBase implements ISkin
	{
		public function DefaultListItemSkin()
		{
			super();
		}
		public function draw(target:Component):void
		{
			var g:Graphics = target.graphics;
			g.clear();
			var c:IListItemRender = target as IListItemRender;
			var fillColor:uint = 0;
			if(c.selected)
			{
				fillColor = 0xff0000;
			}
			else if(target.mouseStatus == MouseStatus.OVER)
			{
				fillColor = 0x00ff00;
			}
			else if(target.mouseStatus == MouseStatus.DOWN)
			{
				fillColor == 0x00ff99;
			}
			else
				fillColor = 0xffffff;
			g.beginFill(fillColor, 0.7);
			g.drawRect(0, 0, target.width, target.height);
			g.endFill();
		}
	}
}